#include "hplcsparklinkautosamplerdevicesendpacket.h"
#include "hplcsparklinkautosamplerprotocoldata.h"
#include "hplcsparklinkautosamplerpfcid.h"
#include "hplcsparklinkpacketformat.h"
#include "hplcsparklinkmakepacket.h"
#include "hplcsparklinkcheckpacket.h"

namespace hplc
{
namespace sparklink
{

HplcSparkLinkAutoSamplerDeviceSendPacket::HplcSparkLinkAutoSamplerDeviceSendPacket(HplcSparkLinkAutoSamplerProtocolData &data, QObject *parent)
    : BaseSendPacket (data, parent)
{

}

HplcSparkLinkAutoSamplerDeviceSendPacket::~HplcSparkLinkAutoSamplerDeviceSendPacket()
{

}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_analysisTime(quint8 hour, quint8 minute, quint8 second)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_AnalysisTime);
    maker->addZero(1);
    maker->add_10(hour);
    maker->add_100(minute);
    maker->add_100(second);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply();
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_loopVolume(quint16 volume)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_LoopVolume);
    maker->addZero(2);
    maker->add_10000(volume);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply();
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_firstSamplePosition(quint8 plateNumber, quint8 columnNumber, quint8 rowNumber)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_FirstSamplePosition);
    maker->addZero(1);
    maker->add_10(plateNumber);
    maker->add_100(columnNumber);
    maker->add_100(rowNumber);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply();
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_lastSamplePosition(quint8 plateNumber, quint8 columnNumber, quint8 rowNumber)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_LastSamplePosition);
    maker->addZero(1);
    maker->add_10(plateNumber);
    maker->add_100(columnNumber);
    maker->add_100(rowNumber);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply();
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_flushVolume(quint16 volume)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_FlushVolume);
    maker->addZero(2);
    maker->add_10000(volume);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply();
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_numberOfInjectionsOrSample(quint8 number)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_NumberOfInjectionsOrSample);
    maker->addZero(5);
    maker->add_10(number);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply();
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_injectionMode(quint8 mode)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_InjectionMode);
    maker->addZero(5);
    maker->add_10(mode);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply();
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_syringeVolume(quint16 volume)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_SyringeVolume);
    maker->addZero(1);
    maker->add_100000(volume);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply();
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_tubingVolume(quint16 volume)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_TubingVolume);
    maker->addZero(3);
    maker->add_1000(volume);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply();
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_firstTransportVial(quint8 plateNumber, quint16 number)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_FirstTransportVial);
    maker->addZero(1);
    maker->add_10(plateNumber);
    maker->add_10000(number);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply();
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_lastTransportVial(quint8 plateNumber, quint16 number)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_LastTransportVial);
    maker->addZero(1);
    maker->add_10(plateNumber);
    maker->add_10000(number);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply();
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_sampleNeedleHeight(quint8 level)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_SampleNeedleHeight);
    maker->addZero(4);
    maker->add_100(level);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply();
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_syringeSpeed(quint8 level)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_SyringeSpeed);
    maker->addZero(5);
    maker->add_10(level);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply();
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_syringeSpeedScaleFactor(quint8 factor)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_SyringeSpeedScaleFactor);
    maker->addZero(4);
    maker->add_100(factor);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply();
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_bufferVolume(quint16 volume)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_BufferVolume);
    maker->addZero(2);
    maker->add_10000(volume);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply();
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_actualSampleNumber(quint8 plateNumber, quint8 columnNumber, quint8 rowNumber)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_FirstSamplePosition);
    maker->addZero(1);
    maker->add_10(plateNumber);
    maker->add_100(columnNumber);
    maker->add_100(rowNumber);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply();
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_status(quint8 isError, quint16 status)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_SendActualValue);
    maker->addZero(2);
    maker->add_10(isError);
    maker->add_1000(status);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_Status);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_errorCode(quint16 errorCode)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_SendActualValue);
    maker->addZero(3);
    maker->add_1000(errorCode);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_ErrorCode);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_airSegment(quint8 isUsed)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_AirSegment);
    maker->addZero(5);
    maker->add_10(isUsed);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_ErrorCode);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_skipMissingSamplePosition(quint8 flag)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_SkipMissingSamplePosition);
    maker->addZero(5);
    maker->add_10(flag);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_SkipMissingSamplePosition);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_headSpacePressure(quint8 flag)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_HeadSpacePressure);
    maker->addZero(5);
    maker->add_10(flag);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_HeadSpacePressure);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_resetOutputAfterSerials(quint8 flag)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_ResetOutputAfterSerials);
    maker->addZero(5);
    maker->add_10(flag);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_ResetOutputAfterSerials);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_usePrepMode(quint8 flag)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_UsePrepMode);
    maker->addZero(5);
    maker->add_10(flag);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_UsePrepMode);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_traySegmentSettings(quint8 leftTrayType, quint8 rightTrayType, quint8 leftType, quint8 rightType)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_TraySegmentSettings);
    maker->addZero(2);
    maker->add_10(leftTrayType);
    maker->add_10(rightTrayType);
    maker->add_10(leftType);
    maker->add_10(rightType);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_TraySegmentSettings);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_traySegmentSettings_SinglePlate(quint8 type)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_TraySegmentSettings);
    maker->addZero(4);
    maker->add_100(type);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_TraySegmentSettings);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_syncCondition(quint8 syncWithNextInjection, quint8 syncWithLoad, quint8 syncWithInject, quint8 syncWithValveWash)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_SyncCondition);
    maker->addZero(2);
    maker->add_10(syncWithNextInjection);
    maker->add_10(syncWithLoad);
    maker->add_10(syncWithInject);
    maker->add_10(syncWithValveWash);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_SyncCondition);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_injectionVolume(quint16 volume)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_InjectionVolume);
    maker->addZero(1);
    maker->add_100000(volume);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_InjectionVolume);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_washBetween(quint8 between)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_WashBetween);
    maker->addZero(5);
    maker->add_10(between);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_WashBetween);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_washTimes(quint8 steps, quint8 times)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(steps);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_WashTimes);
    maker->addZero(5);
    maker->add_10(times);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_WashTimes);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_washSyringeValveSolventPort(quint8 step, quint8 port)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(step);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_WashSyringeValveSolventPort);
    maker->addZero(5);
    maker->add_10(port);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_WashSyringeValveSolventPort);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_fillTransportPositionTimes(quint8 port, quint8 times)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_FillTransportPositionTimes);
    maker->addZero(3);
    maker->add_10(port);
    maker->add_10(0);
    maker->add_10(times);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_FillTransportPositionTimes);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_washVolume(quint8 step, quint16 volume)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(step);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_WashVolume);
    maker->addZero(2);
    maker->add_10000(volume);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_WashVolume);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_useInMethod(quint8 usedTimedEvents, quint8 usedMix)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_UseInMethod);
    maker->addZero(4);
    maker->add_10(usedTimedEvents);
    maker->add_10(usedMix);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_UseInMethod);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_serialNumber(quint32 serial)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_SerialNumber);
    maker->add_1000000(serial);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_SerialNumber);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_clearMixOrUserProg(quint8 flag)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_ClearMixOrUserProg);
    maker->addZero(5);
    maker->add_10(flag);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_SerialNumber);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_clearMethod(quint8 flag)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_ClearMethod);
    maker->addZero(5);
    maker->add_10(flag);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_ClearMethod);
}

void HplcSparkLinkAutoSamplerDeviceSendPacket::P_doorSensor(quint8 isInterrupt)
{
    HplcSparkLinkAutoSamplerProtocolData *d = static_cast<HplcSparkLinkAutoSamplerProtocolData*>(this->m_d);
    HplcSparkLinkMakePacket *maker = d->m_maker;
    maker->preMakePacket();
    maker->addId();
    maker->addAi(0x01);
    maker->addPfc(HplcSparkLinkAutoSamplerPfcId_SendActualValue);
    maker->addZero(5);
    maker->add_10(isInterrupt);
    maker->postMakePacket();

    d->m_checker->send();
    d->m_checker->waitReply(HplcSparkLinkAutoSamplerPfcId_DoorSensor);
}

} // sparklink
} // hplc
